Chris Pollett > Old Classes > CS174
( Print View )

Student Corner:
  [Submit Sec1]
  [Grades Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Description]
  [Course Outcomes]
  [Outcomes Matrix]
  [Course Schedule]
  [Grading]
  [Requirements/HW/Quizzes]
  [Class Protocols]
  [Exam Info]
  [Regrades]
  [University Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Midterm]  [Final]

                           












CS174 Spring 2017Practice Final

Studying for one of my tests does involve some memorization. I believe this is an important skill. Often people waste a lot of time and fail to remember the things they are trying to memorize. Please use a technique that has been shown to work such as the method of loci. Other memorization techniques can be found off the Wiki Page for Moonwalking with Einstein. Given this, to study for the midterm, I suggest you:

  • Know how to do (by heart) all the practice problems.
  • Go over your notes at least three times. Second and third time try to see how much you can remember from the first time.
  • Go over the homework problems.
  • Try to create your own problems similar to the ones I have given and solve them.
  • If you want to study in groups, at this point you are ready to quiz each other.

Here are some facts about the actual final:

  1. It is comprehensive covering all the material of the semester.
  2. It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test.
  3. You should bring photo ID.
  4. There will be more than one version of the test. Each version will be of comparable difficulty.
  5. It is 10 problems, 6 problems will be on material since the midterm, four problems will come from the topics covered prior to the midterm.
  6. Two problems will be exactly (less typos) off of the practice final, and one will be off of practice midterm.

The practice final is below:

  1. Briefly explain how to make a patch from the last 5 commits to a git repository.
  2. Write a Javascript function ascendingUghNumbers(...), that can take a variable number of arguments, and which returns sorted array of those arguments which were Numbers, prefixing those Numbers with "Ugh". For example, ascendingUghNumbers(2.3, 3, "lala", 1, [0, 1], {o:"yeah"}) would return [Ugh1, Ugh2.3, Ugh3].
  3. Describe how the value of an object property is looked up in Javascript.
  4. Write a short Javascript function which when called checks each input tag on the current document. If any of them contain a string f followed by 1 or more o's followed by d, it pops up an alert saying, "I'm busy eating!", and returns false. Otherwise, it returns true.
  5. Give code to associate the busyEating function with a DOM 2, capture click event for the submit button with id hungry.
  6. Write a simple DTD that has as its main element the tag NewsArticle, and which has as subelements Title, Date, Body, Author, and Newspaper. Your language should support a NewsArticle having a free attribute which can only have for its value free.
  7. Explain and give an example for each of the following: (a) C10K problem, (b) REST, (c) Promise.
  8. Describe each of the following ways to attack a web-site: (a) CSRF attack, (b) XSS Attack, (c) Inclusion Attack
  9. Show with code (a) how to serve a static page with express, (b) how to connect to a mysql database in node, (c) how to determine the value of a posted form variable in Express.
  10. Show with code how to detect the orientation of a phone in a browser using Javascript.